<?php
/**
 * Created by PhpStorm.
 * User: 胥九庆
 * Date: 2023/01/09
 * Time: 9:33
 */
declare (strict_types=1);

namespace app\common\model;

class AccountCate extends Base
{
    protected $name = 'user_account_cate';

    public static function cateList($type = 1, $cate = 1)
    {
        $list = parent::where('cate', $cate)->select()->toArray();
        if ($type == 2) {
            $new_list = [];
            foreach ($list as $val) {
                $new_list[$val['id']] = $val['name'];
            }
            $list = $new_list;
        }

        return $list;
    }
}